//
// Created by 123 on 2024/12/30.
//
#include "iostream"
using namespace std;
//发现是引用，转换为int* const ref = &a;
void func(int& ref){
    ref = 100;//ref是引用，转换为*ref = 100;
}

int main046(){
    int a = 10;
    //自动转换为int* const ref = &a;指向常量是指针指向不可改，也说明了为什么引用不能修改
    int& ref = a;
    ref = 20;//内部发现ref是引用，自动帮我们转换为*ref = 20;

    cout << "a==" << a << endl;
    cout << "ref=" << ref <<endl;

    return 0;
}